package com.liu.yupao.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.liu.yupao.model.dto.user.UserUpdateRequest;
import com.liu.yupao.model.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.liu.yupao.model.vo.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 用户服务

 */
public interface UserService extends IService<User> {

    /**
     * 用户注册
     *
     * @param userAccount   用户账户
     * @param userPassword  用户密码
     * @param checkPassword 校验密码
     * @return 新用户 id
     */
    long userRegister(String userAccount, String userPassword, String checkPassword);

    /**
     * 用户登录
     * @return 脱敏后的用户信息
     */
    UserVO userLogin(String userAccount, String userPassword, HttpServletRequest request);


    /**
     * 用户注销
     */
    int userLogout(HttpServletRequest request);

    /**
     * 根据标签内容查找用户
     */
    List<UserVO> searchUsersByTags(List<String> tagNames);

    /**
     * 判断是否是管理员
     */
    Boolean isAdmin(HttpServletRequest request);


    /**
     * 更新用户信息
     */
    int updateUser(UserUpdateRequest userUpdateRequest, HttpServletRequest request);

    /**
     * 获取当前登录用户
     */
    User getLoginUser(HttpServletRequest request);

    /**
     * 查询推荐用户
     */
    Page<User> recommendUsers(long current, long pageSize,HttpServletRequest request);

    /**
     * 获取最匹配的用户信息
     */
    List<UserVO> match (Long num, HttpServletRequest request);
}
